package yuque.a1至20.CalculateEContinuously;

/**
 * ClassName: LowAverengeScores
 * Package: yuque
 * Description:
 *
 * @Author fjorid
 * @Create 2024/12/30 20:06
 * @Version 1.0
 */
class LowScores {
    public static void main(String[] args) {
        // 学生成绩数组
        int[] scores = {85, 90, 78, 92, 65, 88, 75, 84, 91, 76};

        // 计算总分
        double sum = 0;
        for (int i = 0; i < scores.length; i++) {
            sum += scores[i];
        }
        double average = sum / scores.length;

        // 输出平均分
        System.out.println("平均分是: " + average);

        // 找出并输出低于平均分的学生成绩
        System.out.println("低于平均分的成绩有:");
        for (int i = 0; i < scores.length; i++) {
            if (scores[i] < average) {
                System.out.println(scores[i]);
            }
        }
    }
}